package com.yanqu.road.entity.estatewar.palace;

import com.alibaba.fastjson.JSON;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.player.UserBaseInfo;

import java.util.Objects;

public class PalaceBattleNotice extends DataObject {
    private int activityId;
    private String noticeUid;
    private boolean isWin;
    private long noticeTime;
    private long userId;
    private UserBaseInfo userInfo;
    private long enemyUserId;
    private UserBaseInfo enemyUserInfo;
    private int pos;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if(this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public String getNoticeUid() {
        return noticeUid;
    }

    public void setNoticeUid(String noticeUid) {
        if(!Objects.equals(this.noticeUid, noticeUid)) {
            this.noticeUid = noticeUid;
            setUpdateOption();
        }
    }

    public boolean isWin() {
        return isWin;
    }

    public void setWin(boolean win) {
        if(isWin != win) {
            isWin = win;
            setUpdateOption();
        }
    }

    public long getNoticeTime() {
        return noticeTime;
    }

    public void setNoticeTime(long noticeTime) {
        if(this.noticeTime != noticeTime) {
            this.noticeTime = noticeTime;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public UserBaseInfo getUserInfo() {
        return userInfo;
    }

    public String getUserInfoJsonStr(){
        if(null == userInfo){
            return "{}";
        }else {
            return JSON.toJSONString(userInfo);
        }
    }

    public void setUserInfo(UserBaseInfo userInfo) {
        if(!Objects.equals(this.userInfo, userInfo)) {
            this.userInfo = userInfo;
            setUpdateOption();
        }
    }

    public long getEnemyUserId() {
        return enemyUserId;
    }

    public void setEnemyUserId(long enemyUserId) {
        if(this.enemyUserId != enemyUserId) {
            this.enemyUserId = enemyUserId;
            setUpdateOption();
        }
    }

    public UserBaseInfo getEnemyUserInfo() {
        return enemyUserInfo;
    }

    public String getEnemyUserInfoJsonStr(){
        if(null == enemyUserInfo){
            return "{}";
        }else {
            return JSON.toJSONString(enemyUserInfo);
        }
    }

    public void setEnemyUserInfo(UserBaseInfo enemyUserInfo) {
        if(!Objects.equals(this.enemyUserInfo, enemyUserInfo)) {
            this.enemyUserInfo = enemyUserInfo;
            setUpdateOption();
        }
    }

    public int getPos() {
        return pos;
    }

    public void setPos(int pos) {
        if(this.pos != pos) {
            this.pos = pos;
            setUpdateOption();
        }
    }
}
